<template>
  <div id="editor">
    <mavon-editor
      style="height: 100%"
      v-model="contant"
      ref="md"
      @imgAdd="$imgAdd"
      @imgDel="$imgDel"
    ></mavon-editor>
  </div>
</template>

<script>
import { mavonEditor } from 'mavon-editor';
import 'mavon-editor/dist/css/index.css';
export default {
  name: 'mdEditor',
  model: {
    prop: 'value',
    event: 'change'
  },
  props: {
    value: String
  },
  components: {
    mavonEditor,
  },
  data() {
    return {
      contant: ''
    };
  },
  mounted() {
      this.$nextTick(() => {
          $vm.$imgUpdateByUrl('./0', '');
      })
  },
  watch: {
    contant(newValue, oldValue) {
      console.log(123123);
      this.$emit('change', this.contant);
    },
    value() {
      this.content = this.value;
    }
  },
}
</script>
<style>
.v-note-wrapper {
  z-index: 1 !important;
}
</style>